package com.kongxiang.cubebit.base.common.exceptions;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serial;

@EqualsAndHashCode(callSuper = true)
@Data
public class BaseException extends Error{
    @Serial
    private static final long serialVersionUID = 1L;
    private String code;
    private String message;
    private String detail;
    private String traceId;

    public BaseException(String code, String message, String detail, String traceId) {
        super(message);
        this.code = code;
        this.message = message;
        this.detail = detail;
        this.traceId = traceId;
    }
    public BaseException(String code, String message, String detail) {
        super(message);
        this.code = code;
        this.message = message;
        this.detail = detail;
    }
    public BaseException(String code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }
    public BaseException(String message) {
        super(message);
        this.message = message;
    }
    public BaseException(String message, Throwable cause) {
        super(message, cause);
        this.message = message;
    }
    public BaseException(Throwable cause) {
        super(cause);
    }
    public BaseException(String code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
        this.message = message;
    }
    public BaseException(String code, String message, String detail, Throwable cause) {
        super(message, cause);
        this.code = code;
        this.message = message;
        this.detail = detail;
    }
    public BaseException(String code, String message, String detail, String traceId, Throwable cause) {
        super(message, cause);
        this.code = code;
        this.message = message;
        this.detail = detail;
        this.traceId = traceId;
    }



}
